package com.dongdong.android.demo.ui.register;

import com.dongdong.android.framework.http.ApiManager;
import com.dongdong.android.framework.http.resultentity.BaseRsultEntity;
import com.dongdong.android.framework.http.resultentity.UserInfoEntity;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by dongdong on 2018/4/8.
 */

public class RegisterModel implements RegisterContract.Model {
    @Override
    public Observable<BaseRsultEntity<String>> getCode(String phone) {
        return ApiManager.getInstance().userService.getCode(phone).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    @Override
    public Observable<BaseRsultEntity<UserInfoEntity>> register() {
        return ApiManager.getInstance().userService.register().subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }


}
